Add standalone layer-wise KV-cache AutoQuant with forward KL - #2272
Draft
meenchen wants to merge 12 commits into
Draft
Add standalone layer-wise KV-cache AutoQuant with forward KL#2272meenchen wants to merge 12 commits into
meenchen wants to merge 12 commits into
Conversation
Assisted-by: OpenAI Codex Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
Contributor
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2272 +/- ##
==========================================
- Coverage 78.94% 76.71% -2.24%
==========================================
Files 522 524 +2
Lines 60550 63901 +3351
==========================================
+ Hits 47803 49019 +1216
- Misses 12747 14882 +2135
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Type of change: new feature.
Adds standalone layer-wise KV-cache AutoQuantize with isolated forward-KL sensitivity:
mtq.auto_quantize_kv_cachewith one supported K/V format selected per eligible attention layer;constraints.kv_effective_bits;examples/hf_ptq/hf_ptq.pythrough a standalone calibration-free recipe.The implementation is architecture-driven. Plain and conditional-generation Qwen causal attention is supported, hybrid full-attention mixers are discovered through their K/V quantizer boundary, and nonattention/Mamba modules remain outside the search. Ambiguous aliases, unsupported distributed execution, structural algorithms, invalid storage declarations, nonpersistent scales, and unsupported K/V pairs fail closed.
GEMM PTQ/AutoQuantize followed by KV AutoQuantize is intentionally excluded and proposed separately in stacked PR #2273.
Usage
Testing
hf_ptq.pypublic-API path.Before your PR is "Ready for review"
CONTRIBUTING.md: N/AAdditional Information
kv_cache_quantized_layers; FP8-K/NVFP4-V additionally requires a compatible asymmetric runtime kernel.